import { GStatic } from "../../../Core/Manager/DataPool";

const { ccclass } = cc._decorator;
@ccclass
export class STowerData extends GStatic {
    public parse(obj: any): boolean {
        for (let i = 0; i < obj.data.length; i++) {
            let raw = GStatic.addonRaw<STowerDataRaw>(obj.data[i]);
            this._data.set(raw.id, raw);
        }
        return true;
    }


    public getInfo() {
        let min = this._data.values<STowerDataRaw>()[0].id;
        let max = this._data.values<STowerDataRaw>()[this._data.size - 1].id;
        return { min, max, count: this._data.size }
    }
}